import type { RouteRecordRaw } from 'vue-router'

/** 默认布局 */
export const Layout = () => import('@/layout/LayoutMix.vue')
export const RedirectView = () => () => import('@/views/default/redirect/index.vue')

/** 静态路由 */
export const constantRoutes: RouteRecordRaw[] = [
  {
    path: '/redirect',
    component: Layout,
    meta: { hidden: true, anonymous: true },
    children: [
      {
        path: '/redirect/:path(.*)',
        component: RedirectView,
      },
    ],
  },
  {
    path: '/login',
    component: () => import('@/views/default/login/index.vue'),
    meta: { hidden: true, anonymous: true },
  },
  {
    path: '/social/callback',
    component: () => import('@/views/default/login/social/index.vue'),
    meta: { hidden: true, anonymous: true },
  },
  {
    path: '/:pathMatch(.*)*',
    component: () => import('@/views/default/error/404.vue'),
    meta: { hidden: true, anonymous: true },
  },
  {
    path: '/403',
    component: () => import('@/views/default/error/403.vue'),
    meta: { hidden: true, anonymous: true },
  },
  {
    path: '/',
    // component: Layout,
    redirect: '/home',
    meta: { hidden: true },
  },
  // children: [
  //   {
  //     path: '/home',
  //     component: () => import('@/views/home/index.vue'),
  //     name: 'Home',
  //     meta: {
  //       title: '首页',
  //       icon: 'icon-dashboard',
  //       svgIcon: 'menu-home',
  //       affix: true,
  //       hidden: false,
  //       breadcrumb: false,
  //       anonymous: false,
  //     },
  //   },
  // ],
  // },
]
